package com.jm.offer.easy;

/**
 * @Description https://leetcode-cn.com/problems/zai-pai-xu-shu-zu-zhong-cha-zhao-shu-zi-lcof/
 * @date 2022/4/24 7:50
 */
public class _53_I_在排序数组中查找数组I {
    public static void main(String[] args) {
        int[] nums = {1};
        int target = 1;
        System.out.println(search(nums,target));
    }

    public static int search(int[] nums, int target) {
        int count = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == target){
                count ++;
            }
        }
        return count;
    }
}
